<script setup lang="ts">
import { Error } from '@/components/Error'
import { useRouter } from 'vue-router'
import { getToken, clearLocal } from '@/utils/auth'

const { push, go } = useRouter()

const errorClick = () => {
  const token = getToken()
  console.log('tk--', token)
  if (token) {
    go(-1 as number)
  } else {
    push('/login' as string)
  }
}
</script>

<template>
  <Error type="500" @error-click="errorClick" />
</template>
